package eCheque;

/**
 * Interface for receiving information about cheques received
 * via a peer-to-peer connection.
 * 
 * @author Steve Pennington
 *
 */
public interface ReceiveChequeHandler {
	/**
	 * Called when a cheque has been successfully received
	 * 
	 * @param cheque
	 * 		Cheque that was received
	 */
	public void chequeReceived(ECheque cheque);
	
	/**
	 * Called when a connection to the peer was established,
	 * but the actual cheque transfer failed
	 * 
	 * @param t
	 * 		Throwable that caused the failure
	 */
	public void receiveFailed(Throwable t);
	
	/**
	 * Called when the client failed to startup a connection listener.
	 * This means the user will be unable to receive peer-to-peer connections.
	 * 
	 * @param t
	 * 		Throwable that caused the failure
	 */
	public void startupFailed(Throwable t);
	
	/**
	 * Called when a peer connection was identified, but failed to connect. This is
	 * possibly a network error on the client side.
	 * 
	 * @param t
	 * 		Throwable that caused the failure
	 */
	public void connectFailed(Throwable t);
}
